# Maintainer: Lukas Fleischer <lfleischer@archlinux.org>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: naelstrof <naelstrof@gmail.com>

pkgname=slop
pkgver=7.6
pkgrel=3
pkgdesc='Utility to query the user for a selection and print the region to stdout'
arch=('loong64' 'x86_64')
url='https://github.com/naelstrof/slop'
license=('GPL3')
depends=('libxext' 'libx11' 'mesa' 'glew' 'libxrender')
makedepends=('cmake' 'glm')
source=("${pkgname}-${pkgver}.tar.gz::$url/archive/v${pkgver}.tar.gz"
        bugfix-add-missed-header.patch)
sha256sums=('ec45f9a69d7a24df621f5c634d202451ddca987d550cf588c5c427b99106fb6b'
            '2e48f2cee54cfe2f08ad821d02b548ad9a4911e091418c859e8db78c39824cbd')

prepare() {
	cd "$pkgname-$pkgver"
	patch -Np1 -i ../bugfix-add-missed-header.patch
}

build() {
	cd "$pkgname-$pkgver"
	cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=/usr/lib .
	make
}

package() {
	make -C "$pkgname-$pkgver" DESTDIR="$pkgdir" install
}
